package fr.generali.accueilclient.gwt.client.ui.components.cell;

import java.util.Iterator;

import com.google.gwt.core.client.GWT;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.HasWidgets;
import com.google.gwt.user.client.ui.Widget;

import fr.generali.accueilclient.gwt.client.ui.resources.GlobalResources;

public class Cell extends Composite implements HasWidgets {

    private static CellUiBinder uiBinder = GWT.create(CellUiBinder.class);

    interface CellUiBinder extends UiBinder<Widget, Cell> {
    }

    @UiField
    GlobalResources res;
    
    @UiField 
    FlowPanel container;
    
    public Cell() {
        initWidget(uiBinder.createAndBindUi(this));
        res.layout().ensureInjected();
    }

    @Override
    public void add(Widget w) {
        container.add(w);
    }

    @Override
    public void clear() {
        container.clear();
    }

    @Override
    public Iterator<Widget> iterator() {
        return container.iterator();
    }

    @Override
    public boolean remove(Widget w) {
        return container.remove(w);
    }
}
